import { _decorator, clamp01, Component, Node, Sprite } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('ProgressBar')
export class ProgressBar extends Component {

    @property(Node)
    fill: Node;

    protected onLoad(): void {
        this.setProgress(0);
    }


    start() {

    }

    update(deltaTime: number) {
        
    }

    setProgress(progress: number) {
        this.fill.getComponent(Sprite).fillRange=clamp01(progress);
    }
}


